package com.tools.model.entity;

import com.tools.commons.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Data
@Table(name = "t_user_pics")
@ApiModel("t_user_pics")
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Where(clause = "deleted = 0")
@EqualsAndHashCode(callSuper = true)
public class PicsEntity extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 自增id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty("自增id")
    @Column(name = "id")
    private Integer id;

    /**
     * 图片云存储key
     */
    @ApiModelProperty("图片云存储key")
    @Column(name = "file_key")
    private String fileKey;

    /**
     * 标签
     */
    @ApiModelProperty("标签")
    @Column(name = "tags")
    private String tags;

    /**
     * 文件类型
     */
    @ApiModelProperty("文件类型")
    @Column(name = "file_type")
    private String fileType;

    /**
     * 文件名
     */
    @ApiModelProperty("文件名")
    @Column(name = "file_name")
    private String fileName;

    @PrePersist
    protected void prePersist() {
        super.prePersist();
    }
}



